﻿$.ajax({
    url: "/info/getAllData",
    type: "GET",
    success: function(data) {
        success(data);
    }
});

function success(data) {
    var result = JSON.parse(data);
    $(".container .time-line").css({
        "height": result.length * 100 + "px"
    });
    for (var i = 0; i < result.length; i++) {
        var childNode = "<div class='square' style='top:" + i * 100 + "px'>" +
            "<div class='time'>"+result[i].time+"</div>" +
            "<div class='content'>" + result[i].content + "</div>" +
            "</div>";
        $(".container .time-line").append(childNode);
    }
}